package com.fy.fyspace.common.config;

import com.zhipu.oapi.ClientV4;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 智普AI模型配置
 *
 * @author fwq
 */
@Configuration
@Data
public class ZhipuAiConfig {

    /**
     * 智普AI API密钥
     */
    @Value("${zhipu.api-key}")
    private String apiKey;

    @Value("${zhipu.model}")
    private String modelName;

    /**
     * 初始化智普AI客户端
     */
    @Bean
    public ClientV4 zhipuAiClient() {
        // 使用apiKey初始化智普AI客户端
        return new ClientV4.Builder(apiKey)
                .build();
    }
}
